<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="header.jsp"%>
		
	    <div class="flex-container">
			<%@ include file="leftmenu.jsp"%>
			<div class="right-container">
			    <div class="right_content">
			    	<div class="header">
			    		<img src="images_c/location.png" />
			    		<h6>首页<span class="relation_symbol">></span><span class="relation_color">载体信息审核</span></h6>
			    	</div>
			    	<div class="tab_content" id="tab_content_enterprise">
			    		<form id="query_form">
				    		<div class="row search_block">
			    				<label class="search_name">选择时间</label>
			    				<div class="input-append date form_date" data-date="" data-date-format="yyyy-mm" data-link-format="yyyy-mm">
							      <input size="16" type="text" value="${month }" name="month" readonly>
							      <span class="add-on"><i class="icon-th"></i></span>
							     </div>
			    				<a href="javascript:void(0)" class="search_btn">查询</a>
					    	</div>
				    	</form>
				    	<div class="row table_container">
				    		<div class="row search_result">
				    			<div class="search_result_left">
				    				<div class="search_result_icon"></div>
				    			    <p class="search_result_label">查询结果</p>
				    			</div>
				    			<%-- <div class="search_result_right">
				    				<a href="javascript:void(0)" class="report_add"><img src="<%=path%>/resources/new/images/operation1.png" /></a> 
				    				<span>增加</span>
				    				<a href="javascript:void(0)" class="report_copy"><img src="<%=path%>/resources/new/images/operation2.png" /></a>
				    				<span>复制</span>
				    				<a href="javascript:void(0)" class="report_confirm"><img src="<%=path%>/resources/new/images/operation3.png" /></a>
				    				<span>上报</span>
				    				<a href="javascript:void(0)" class="report_cancel"><img src="<%=path%>/resources/new/images/operation4.png" /></a>
				    				<span>取消上报</span>
				    				<a href="javascript:void(0)" class="process_tanchuang"><img src="<%=path%>/resources/new/images/operation5.png" /></a>
				    				<span>流程查看</span>
				    			</div> --%>
				    		</div>
				    		<div class="table_block">
				    			<div class="table_block_report">
					    			<table id="report_table" class="table table-center table-striped table-bordered table-hover"
									cellspacing="0" width="3000px">
						    			<thead>
						    				<tr>
						    					<th>序号</th>
						    					<th>月份</th>
						    					<th>载体名</th>
						    					<th>载体状态</th>
						    					<th>运营单位</th>
						    					<th>负责人</th>
						    					<th>联系方式</th>
						    					<th>总面积</th>
						    					<th>完成时间</th>
						    					<th>投资额</th>
						    					<th>审核状态</th>
						    					<th>操作</th>
						    				</tr>
						    			</thead>
						    			<tbody>
						    				<c:forEach items="${list}" var="a" varStatus="b">
						    				<tr>
						    					<td>${b.count }</td>
						    					<td>${a.month }</td>
						    					<td>${a.carrierName }</td>
						    					<td>${a.status }</td>
						    					<td>${a.organization }</td>
						    					<td>${a.master }</td>
						    					<td>${a.contact }</td>
						    					<td>${a.acreage }</td>
						    					<td>${a.completeTime }</td>
						    					<td>${a.investmentAmount }</td>
						    					<td>
						    						<c:if test="${a.auditStatus eq '0' }">未上报</c:if>
						    						<c:if test="${a.auditStatus eq '1' or a.auditStatus eq '2' }">待审核</c:if>
						    						<c:if test="${a.auditStatus eq '3' }">已通过</c:if>
						    						<c:if test="${a.auditStatus eq '4' }">未通过</c:if>
						    						<c:if test="${a.auditStatus eq '9' }">已取消</c:if>
						    					</td>
						    					<td>
						    					<c:if test="${a.auditStatus eq '1' or a.auditStatus eq '2' }">
						    						<button type="button" class="btn btn-default" onclick="auditReport('${a.id}');">审核</button> 
						    					</c:if>
						    					</td>
						    				</tr>
						    				</c:forEach>
						    			</tbody>
						    		</table>
				    			</div>
					    	</div>
					    	<!--弹窗-->
				    	<div class="background" id="bg" style="display: none;">
							<div class="tanchuang" style="height:400px;overflow-y: auto;">
								<div class="tanchuang_close"><img src="images_c/tanchuang_close.png" class="close"/></div>
								<div class="tanchuang_title" style="margin-top: 22px;">
									<img src="images_c/tanhcuang_shenhe.png" />
									<p class="tanchuang_title_name">审核载体上报信息</p>
								</div>
								<div class="tanchuang_content" style="margin-top:30px;">
									<form id="audit_form">
										<!-- <div class="form_group">
											<label class="tanchuang_label">用户名</label>
											<input type="text" value="74829_jfg" class="tanchuang_input"/>
										</div> -->
										<div class="form_group">
											<label class="tanchuang_label">处理反馈意见</label>
											<textarea class="text_view"></textarea>
											<input type="text" id="reportid" name="reportid" value="" class="tanchuang_input" style="display: none;" />
										</div>
										<div class="form_group">
											<label class="tanchuang_label">处理状态</label>
											<input type="radio" checked="checked" name="status" value="1" class="tanchu_radio"/>
											<span class="tanchu_status" >通过</span>
											<input type="radio" name="status" value="2" class="tanchu_radio"/>
											<span class="tanchu_status">未通过</span>
										</div>
										<div class="form_group">
											<label class="tanchuang_label">&nbsp;</label>
											<div class="btn_group">
												<a class="tanchu_btn tanchu_btn_color1 audit_submit" style="margin-right: 50px">提交</a>
												<a class="tanchu_btn tanchu_btn_color2" id="cancle">取消</a>
											</div>
										</div>
									</form>
								</div>
							</div>
						</div>
						<!--弹窗结束-->
				    	</div>
			    	</div>
			  
			    </div>
		    </div>
		</div>
	
	<script>
		$(document).ready(function(){
			$(".audit_btn").click(function(){
				$(".background").fadeIn();
			});
			$('.close').click(function() {
				$('.background').fadeOut();
				$('.tanchuang_input').val('');
			});
			$('#cancle').click(function() {
				$('.background').fadeOut();
				$('.tanchuang_input').val('');
			});
		});
		
		$(".audit_submit").click(function() {
			$.ajax({  
			    type: "POST",  
			    url:"<%=path%>/admin/reportCheck",  
			    data:$('#audit_form').serialize(),  
			    async: false,  
			    error: function(request) {  
			        alert("系统异常");  
			    },  
			    success: function(data) { 
			        //接收后台返回的结果  
			    	alert('审核成功！');
					window.location.href="<%=path %>/admin/reportAudit"; 
			    }  
			  });
		});
		$(".search_btn").click(function(){
			var data = $('#query_form').serialize();
			window.location.href="<%=path %>/admin/reportAudit?" + data
		});
		
		$(".form_date").datetimepicker({
			format:'yyyy-mm', 
	        language:  'zh-CN',
	        weekStart: 1,
	        todayBtn:  1,
			autoclose: 1,
			todayHighlight: 1,
			startView: 3,
			minView: 3,
			forceParse: 0
		 });
		
		
		function auditReport(id){
			$(".background").fadeIn();
			$("#reportid").attr("value", id);
		}
		
	</script>
